<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
MinMaxPriorityQueue (Guava: Google Core Libraries for Java - r08)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="MinMaxPriorityQueue (Guava: Google Core Libraries for Java - r08)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/google/common/collect/Maps.EntryTransformer.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.Builder.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?com/google/common/collect/MinMaxPriorityQueue.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MinMaxPriorityQueue.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.google.common.collect</FONT>
<BR>
Class MinMaxPriorityQueue&lt;E&gt;</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util">java.util.AbstractCollection</A>&lt;E&gt;
      <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true" title="class or interface in java.util">java.util.AbstractQueue</A>&lt;E&gt;
          <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.google.common.collect.MinMaxPriorityQueue&lt;E&gt;</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;E&gt;, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;E&gt;, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Queue.html?is-external=true" title="class or interface in java.util">Queue</A>&lt;E&gt;</DD>
</DL>
<HR>
<DL>
<DT><PRE><FONT SIZE="-1"><A HREF="../../../../com/google/common/annotations/Beta.html" title="annotation in com.google.common.annotations">@Beta</A>
</FONT>public final class <B>MinMaxPriorityQueue&lt;E&gt;</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true" title="class or interface in java.util">AbstractQueue</A>&lt;E&gt;</DL>
</PRE>

<P>
A double-ended priority queue, which provides constant-time access to both
 its least element and its greatest element, as determined by the queue's
 specified comparator. If no comparator is given at construction time, the
 natural order of elements is used.

 <p>As a <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Queue.html?is-external=true" title="class or interface in java.util"><CODE>Queue</CODE></A> it functions exactly as a <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/PriorityQueue.html?is-external=true" title="class or interface in java.util"><CODE>PriorityQueue</CODE></A>: its
 head element -- the implicit target of the methods <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#peek()"><CODE>peek()</CODE></A>, <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#poll()"><CODE>poll()</CODE></A> and <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#remove()" title="class or interface in java.util"><CODE>AbstractQueue.remove()</CODE></A> -- is defined as the <i>least</i> element in
 the queue according to the queue's comparator. But unlike a regular priority
 queue, the methods <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#peekLast()"><CODE>peekLast()</CODE></A>, <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#pollLast()"><CODE>pollLast()</CODE></A> and
 <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#removeLast()"><CODE>removeLast()</CODE></A> are also provided, to act on the <i>greatest</i> element
 in the queue instead.

 <p>A min-max priority queue can be configured with a maximum size. If so,
 each time the size of the queue exceeds that value, the queue automatically
 removes its greatest element according to its comparator (which might be the
 element that was just added). This is different from conventional bounded
 queues, which either block or reject new elements when full.

 <p>This implementation is based on the
 <a href="http://portal.acm.org/citation.cfm?id=6621">min-max heap</a>
 developed by Atkinson, et al. Unlike many other double-ended priority queues,
 it stores elements in a single array, as compact as the traditional heap data
 structure used in <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/PriorityQueue.html?is-external=true" title="class or interface in java.util"><CODE>PriorityQueue</CODE></A>.

 <p>This class is not thread-safe, and does not accept null elements.

 <p><i>Performance notes:</i>

 <ul>
 <li>The retrieval operations <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#peek()"><CODE>peek()</CODE></A>, <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#peekFirst()"><CODE>peekFirst()</CODE></A>, <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#peekLast()"><CODE>peekLast()</CODE></A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#element()" title="class or interface in java.util"><CODE>AbstractQueue.element()</CODE></A>, and <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#size"><CODE>size</CODE></A> are constant-time
 <li>The enqueing and dequeing operations (<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#offer(E)"><CODE>offer(E)</CODE></A>, <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#add(E)"><CODE>add(E)</CODE></A>, and
     all the forms of <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#poll()"><CODE>poll()</CODE></A> and <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#remove()" title="class or interface in java.util"><CODE>AbstractQueue.remove()</CODE></A>) run in <code>O(log n) time</code>
 <li>The <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util"><CODE>AbstractCollection.remove(Object)</CODE></A> and <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#contains(java.lang.Object)" title="class or interface in java.util"><CODE>AbstractCollection.contains(java.lang.Object)</CODE></A> operations require
     linear (<code>O(n)</code>) time
 </ul>
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>8</DD>
<DT><B>Author:</B></DT>
  <DD>Sverre Sundsdal, Torbjorn Gannholm</DD>
</DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->

<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.Builder.html" title="class in com.google.common.collect">MinMaxPriorityQueue.Builder</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.Builder.html" title="type parameter in MinMaxPriorityQueue.Builder">B</A>&gt;</B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The builder class used in creation of min-max priority queues.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#add(E)">add</A></B>(<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&nbsp;element)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the given element to this queue.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#addAll(java.util.Collection)">addAll</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;? extends <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;&nbsp;newElements)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds all of the elements in the specified collection to this
 queue.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#clear()">clear</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all of the elements from this queue.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A>&lt;? super <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#comparator()">comparator</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the comparator used to order the elements in this queue.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;E extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&lt;E&gt;&gt; 
<BR>
<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="class in com.google.common.collect">MinMaxPriorityQueue</A>&lt;E&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#create()">create</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new min-max priority queue with default settings: natural order,
 no maximum size, no initial contents, and an initial expected size of 11.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;E extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&lt;E&gt;&gt; 
<BR>
<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="class in com.google.common.collect">MinMaxPriorityQueue</A>&lt;E&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#create(java.lang.Iterable)">create</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;? extends E&gt;&nbsp;initialContents)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new min-max priority queue using natural order, no maximum size,
 and initially containing the given elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.Builder.html" title="class in com.google.common.collect">MinMaxPriorityQueue.Builder</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#expectedSize(int)">expectedSize</A></B>(int&nbsp;expectedSize)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates and returns a new builder, configured to build <code>MinMaxPriorityQueue</code> instances sized appropriately to hold <code>expectedSize</code> elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#iterator()">iterator</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an iterator over the elements contained in this collection,
 <i>in no particular order</i>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.Builder.html" title="class in com.google.common.collect">MinMaxPriorityQueue.Builder</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#maximumSize(int)">maximumSize</A></B>(int&nbsp;maximumSize)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates and returns a new builder, configured to build <code>MinMaxPriorityQueue</code> instances that are limited to <code>maximumSize</code>
 elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#offer(E)">offer</A></B>(<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&nbsp;element)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds the given element to this queue.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;B&gt; <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.Builder.html" title="class in com.google.common.collect">MinMaxPriorityQueue.Builder</A>&lt;B&gt;</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#orderedBy(java.util.Comparator)">orderedBy</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A>&lt;B&gt;&nbsp;comparator)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates and returns a new builder, configured to build <code>MinMaxPriorityQueue</code> instances that use <code>comparator</code> to determine the
 least and greatest elements.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#peek()">peek</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves, but does not remove, the head of this queue,
 or returns <tt>null</tt> if this queue is empty.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#peekFirst()">peekFirst</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves, but does not remove, the least element of this queue, or returns
 <code>null</code> if the queue is empty.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#peekLast()">peekLast</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves, but does not remove, the greatest element of this queue, or
 returns <code>null</code> if the queue is empty.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#poll()">poll</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves and removes the head of this queue,
 or returns <tt>null</tt> if this queue is empty.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#pollFirst()">pollFirst</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes and returns the least element of this queue, or returns <code>null</code> if the queue is empty.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#pollLast()">pollLast</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes and returns the greatest element of this queue, or returns <code>null</code> if the queue is empty.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#removeFirst()">removeFirst</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes and returns the least element of this queue.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#removeLast()">removeLast</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes and returns the greatest element of this queue.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#size()">size</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of elements in this collection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html#toArray()">toArray</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array containing all of the elements in this collection.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.util.AbstractQueue"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.util.<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true" title="class or interface in java.util">AbstractQueue</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#element()" title="class or interface in java.util">element</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#remove()" title="class or interface in java.util">remove</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.util.AbstractCollection"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.util.<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util">AbstractCollection</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#contains(java.lang.Object)" title="class or interface in java.util">contains</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#containsAll(java.util.Collection)" title="class or interface in java.util">containsAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#isEmpty()" title="class or interface in java.util">isEmpty</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util">remove</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#removeAll(java.util.Collection)" title="class or interface in java.util">removeAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#retainAll(java.util.Collection)" title="class or interface in java.util">retainAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#toArray(T[])" title="class or interface in java.util">toArray</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#toString()" title="class or interface in java.util">toString</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.util.Collection"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface java.util.<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#contains(java.lang.Object)" title="class or interface in java.util">contains</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#containsAll(java.util.Collection)" title="class or interface in java.util">containsAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#hashCode()" title="class or interface in java.util">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#isEmpty()" title="class or interface in java.util">isEmpty</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util">remove</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#removeAll(java.util.Collection)" title="class or interface in java.util">removeAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#retainAll(java.util.Collection)" title="class or interface in java.util">retainAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#toArray(T[])" title="class or interface in java.util">toArray</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="create()"><!-- --></A><H3>
create</H3>
<PRE>
public static &lt;E extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&lt;E&gt;&gt; <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="class in com.google.common.collect">MinMaxPriorityQueue</A>&lt;E&gt; <B>create</B>()</PRE>
<DL>
<DD>Creates a new min-max priority queue with default settings: natural order,
 no maximum size, no initial contents, and an initial expected size of 11.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="create(java.lang.Iterable)"><!-- --></A><H3>
create</H3>
<PRE>
public static &lt;E extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&lt;E&gt;&gt; <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="class in com.google.common.collect">MinMaxPriorityQueue</A>&lt;E&gt; <B>create</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;? extends E&gt;&nbsp;initialContents)</PRE>
<DL>
<DD>Creates a new min-max priority queue using natural order, no maximum size,
 and initially containing the given elements.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="orderedBy(java.util.Comparator)"><!-- --></A><H3>
orderedBy</H3>
<PRE>
public static &lt;B&gt; <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.Builder.html" title="class in com.google.common.collect">MinMaxPriorityQueue.Builder</A>&lt;B&gt; <B>orderedBy</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A>&lt;B&gt;&nbsp;comparator)</PRE>
<DL>
<DD>Creates and returns a new builder, configured to build <code>MinMaxPriorityQueue</code> instances that use <code>comparator</code> to determine the
 least and greatest elements.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="expectedSize(int)"><!-- --></A><H3>
expectedSize</H3>
<PRE>
public static <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.Builder.html" title="class in com.google.common.collect">MinMaxPriorityQueue.Builder</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&gt; <B>expectedSize</B>(int&nbsp;expectedSize)</PRE>
<DL>
<DD>Creates and returns a new builder, configured to build <code>MinMaxPriorityQueue</code> instances sized appropriately to hold <code>expectedSize</code> elements.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="maximumSize(int)"><!-- --></A><H3>
maximumSize</H3>
<PRE>
public static <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.Builder.html" title="class in com.google.common.collect">MinMaxPriorityQueue.Builder</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&gt; <B>maximumSize</B>(int&nbsp;maximumSize)</PRE>
<DL>
<DD>Creates and returns a new builder, configured to build <code>MinMaxPriorityQueue</code> instances that are limited to <code>maximumSize</code>
 elements. Each time a queue grows beyond this bound, it immediately
 removes its greatest element (according to its comparator), which might be
 the element that was just added.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="size()"><!-- --></A><H3>
size</H3>
<PRE>
public int <B>size</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#size()" title="class or interface in java.util">java.util.Collection</A></CODE></B></DD>
<DD>Returns the number of elements in this collection.  If this collection
 contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
 <tt>Integer.MAX_VALUE</tt>.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#size()" title="class or interface in java.util">size</A></CODE> in interface <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#size()" title="class or interface in java.util">size</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the number of elements in this collection</DL>
</DD>
</DL>
<HR>

<A NAME="add(java.lang.Object)"><!-- --></A><A NAME="add(E)"><!-- --></A><H3>
add</H3>
<PRE>
public boolean <B>add</B>(<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&nbsp;element)</PRE>
<DL>
<DD>Adds the given element to this queue. If this queue has a maximum size,
 after adding <code>element</code> the queue will automatically evict its
 greatest element (according to its comparator), which may be <code>element</code> itself.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#add(E)" title="class or interface in java.util">add</A></CODE> in interface <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Queue.html?is-external=true#add(E)" title="class or interface in java.util">add</A></CODE> in interface <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Queue.html?is-external=true" title="class or interface in java.util">Queue</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#add(E)" title="class or interface in java.util">add</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true" title="class or interface in java.util">AbstractQueue</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to add
<DT><B>Returns:</B><DD><code>true</code> always</DL>
</DD>
</DL>
<HR>

<A NAME="addAll(java.util.Collection)"><!-- --></A><H3>
addAll</H3>
<PRE>
public boolean <B>addAll</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;? extends <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;&nbsp;newElements)</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#addAll(java.util.Collection)" title="class or interface in java.util">java.util.AbstractQueue</A></CODE></B></DD>
<DD>Adds all of the elements in the specified collection to this
 queue.  Attempts to addAll of a queue to itself result in
 <tt>IllegalArgumentException</tt>. Further, the behavior of
 this operation is undefined if the specified collection is
 modified while the operation is in progress.

 <p>This implementation iterates over the specified collection,
 and adds each element returned by the iterator to this
 queue, in turn.  A runtime exception encountered while
 trying to add an element (including, in particular, a
 <tt>null</tt> element) may result in only some of the elements
 having been successfully added when the associated exception is
 thrown.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#addAll(java.util.Collection)" title="class or interface in java.util">addAll</A></CODE> in interface <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#addAll(java.util.Collection)" title="class or interface in java.util">addAll</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true" title="class or interface in java.util">AbstractQueue</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newElements</CODE> - collection containing elements to be added to this queue
<DT><B>Returns:</B><DD><tt>true</tt> if this queue changed as a result of the call<DT><B>See Also:</B><DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#add(E)" title="class or interface in java.util"><CODE>AbstractQueue.add(Object)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="offer(java.lang.Object)"><!-- --></A><A NAME="offer(E)"><!-- --></A><H3>
offer</H3>
<PRE>
public boolean <B>offer</B>(<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&nbsp;element)</PRE>
<DL>
<DD>Adds the given element to this queue. If this queue has a maximum size,
 after adding <code>element</code> the queue will automatically evict its
 greatest element (according to its comparator), which may be <code>element</code> itself.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to add
<DT><B>Returns:</B><DD><tt>true</tt> if the element was added to this queue, else
         <tt>false</tt></DL>
</DD>
</DL>
<HR>

<A NAME="poll()"><!-- --></A><H3>
poll</H3>
<PRE>
public <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A> <B>poll</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Queue.html?is-external=true#poll()" title="class or interface in java.util">java.util.Queue</A></CODE></B></DD>
<DD>Retrieves and removes the head of this queue,
 or returns <tt>null</tt> if this queue is empty.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the head of this queue, or <tt>null</tt> if this queue is empty</DL>
</DD>
</DL>
<HR>

<A NAME="peek()"><!-- --></A><H3>
peek</H3>
<PRE>
public <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A> <B>peek</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Queue.html?is-external=true#peek()" title="class or interface in java.util">java.util.Queue</A></CODE></B></DD>
<DD>Retrieves, but does not remove, the head of this queue,
 or returns <tt>null</tt> if this queue is empty.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the head of this queue, or <tt>null</tt> if this queue is empty</DL>
</DD>
</DL>
<HR>

<A NAME="pollFirst()"><!-- --></A><H3>
pollFirst</H3>
<PRE>
public <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A> <B>pollFirst</B>()</PRE>
<DL>
<DD>Removes and returns the least element of this queue, or returns <code>null</code> if the queue is empty.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="removeFirst()"><!-- --></A><H3>
removeFirst</H3>
<PRE>
public <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A> <B>removeFirst</B>()</PRE>
<DL>
<DD>Removes and returns the least element of this queue.
<P>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util">NoSuchElementException</A></CODE> - if the queue is empty</DL>
</DD>
</DL>
<HR>

<A NAME="peekFirst()"><!-- --></A><H3>
peekFirst</H3>
<PRE>
public <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A> <B>peekFirst</B>()</PRE>
<DL>
<DD>Retrieves, but does not remove, the least element of this queue, or returns
 <code>null</code> if the queue is empty.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="pollLast()"><!-- --></A><H3>
pollLast</H3>
<PRE>
public <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A> <B>pollLast</B>()</PRE>
<DL>
<DD>Removes and returns the greatest element of this queue, or returns <code>null</code> if the queue is empty.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="removeLast()"><!-- --></A><H3>
removeLast</H3>
<PRE>
public <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A> <B>removeLast</B>()</PRE>
<DL>
<DD>Removes and returns the greatest element of this queue.
<P>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util">NoSuchElementException</A></CODE> - if the queue is empty</DL>
</DD>
</DL>
<HR>

<A NAME="peekLast()"><!-- --></A><H3>
peekLast</H3>
<PRE>
public <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A> <B>peekLast</B>()</PRE>
<DL>
<DD>Retrieves, but does not remove, the greatest element of this queue, or
 returns <code>null</code> if the queue is empty.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="iterator()"><!-- --></A><H3>
iterator</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt; <B>iterator</B>()</PRE>
<DL>
<DD>Returns an iterator over the elements contained in this collection,
 <i>in no particular order</i>.

 <p>The iterator is <i>fail-fast</i>: If the MinMaxPriorityQueue is modified
 at any time after the iterator is created, in any way except through the
 iterator's own remove method, the iterator will generally throw a
 <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/ConcurrentModificationException.html?is-external=true" title="class or interface in java.util"><CODE>ConcurrentModificationException</CODE></A>. Thus, in the face of concurrent
 modification, the iterator fails quickly and cleanly, rather than risking
 arbitrary, non-deterministic behavior at an undetermined time in the
 future.

 <p>Note that the fail-fast behavior of an iterator cannot be guaranteed
 as it is, generally speaking, impossible to make any hard guarantees in the
 presence of unsynchronized concurrent modification.  Fail-fast iterators
 throw <code>ConcurrentModificationException</code> on a best-effort basis.
 Therefore, it would be wrong to write a program that depended on this
 exception for its correctness: <i>the fail-fast behavior of iterators
 should be used only to detect bugs.</i>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true#iterator()" title="class or interface in java.lang">iterator</A></CODE> in interface <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#iterator()" title="class or interface in java.util">iterator</A></CODE> in interface <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#iterator()" title="class or interface in java.util">iterator</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>an iterator over the elements contained in this collection</DL>
</DD>
</DL>
<HR>

<A NAME="clear()"><!-- --></A><H3>
clear</H3>
<PRE>
public void <B>clear</B>()</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#clear()" title="class or interface in java.util">java.util.AbstractQueue</A></CODE></B></DD>
<DD>Removes all of the elements from this queue.
 The queue will be empty after this call returns.

 <p>This implementation repeatedly invokes <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Queue.html?is-external=true#poll()" title="class or interface in java.util"><CODE>poll</CODE></A> until it
 returns <tt>null</tt>.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#clear()" title="class or interface in java.util">clear</A></CODE> in interface <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true#clear()" title="class or interface in java.util">clear</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractQueue.html?is-external=true" title="class or interface in java.util">AbstractQueue</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="toArray()"><!-- --></A><H3>
toArray</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[] <B>toArray</B>()</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#toArray()" title="class or interface in java.util">java.util.AbstractCollection</A></CODE></B></DD>
<DD>Returns an array containing all of the elements in this collection.
 If this collection makes any guarantees as to what order its elements
 are returned by its iterator, this method must return the elements in
 the same order.

 <p>The returned array will be "safe" in that no references to it are
 maintained by this collection.  (In other words, this method must
 allocate a new array even if this collection is backed by an array).
 The caller is thus free to modify the returned array.

 <p>This method acts as bridge between array-based and collection-based
 APIs.

 <p>This implementation returns an array containing all the elements
 returned by this collection's iterator, in the same order, stored in
 consecutive elements of the array, starting with index <code>0</code>.
 The length of the returned array is equal to the number of elements
 returned by the iterator, even if the size of this collection changes
 during iteration, as might happen if the collection permits
 concurrent modification during iteration.  The <code>size</code> method is
 called only as an optimization hint; the correct result is returned
 even if the iterator returns a different number of elements.

 <p>This method is equivalent to:

  <pre> <code>List&lt;E&gt; list = new ArrayList&lt;E&gt;(size());
 for (E e : this)
     list.add(e);
 return list.toArray();
 </code></pre>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true#toArray()" title="class or interface in java.util">toArray</A></CODE> in interface <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true#toArray()" title="class or interface in java.util">toArray</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/AbstractCollection.html?is-external=true" title="class or interface in java.util">AbstractCollection</A>&lt;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt;</CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>an array containing all of the elements in this collection</DL>
</DD>
</DL>
<HR>

<A NAME="comparator()"><!-- --></A><H3>
comparator</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A>&lt;? super <A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.html" title="type parameter in MinMaxPriorityQueue">E</A>&gt; <B>comparator</B>()</PRE>
<DL>
<DD>Returns the comparator used to order the elements in this queue. Obeys the
 general contract of <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/PriorityQueue.html?is-external=true#comparator" title="class or interface in java.util"><CODE>PriorityQueue.comparator</CODE></A>, but returns <A HREF="../../../../com/google/common/collect/Ordering.html#natural()"><CODE>Ordering.natural()</CODE></A> instead of <code>null</code> to indicate natural ordering.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/google/common/collect/Maps.EntryTransformer.html" title="interface in com.google.common.collect"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../com/google/common/collect/MinMaxPriorityQueue.Builder.html" title="class in com.google.common.collect"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?com/google/common/collect/MinMaxPriorityQueue.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MinMaxPriorityQueue.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>
